import os
import sys

HOME = os.getenv('HOME')
U_BOOT_PATH="%s/SiFive-OE/riscv-sifive/build/tmp-glibc/work/freedom_u540-oe-linux/u-boot/1_2019.07-r0" % HOME
GIT_PATH="%s/configs/haps" % HOME

#dtc ux00_zsbl.dts -o ux00_zsbl.dtb -O dtb
cmds = {
    'config'           : 'build/.config',
    'ux00_zsbl.dtb'    : 'build/arch/riscv/dts/',
    'serial_sifive.c'  : 'git/drivers/serial/serial_sifive.c',
}


for k in sorted(cmds.keys()):
    target_file = '%s/%s' % (U_BOOT_PATH, cmds[k])
    #print(target_file)
    cmd = 'cp -f %20s %s' % (k, target_file)
    print(cmd)
    os.system(cmd)

print('\n\n')

for k in sorted(cmds.keys()):
    target_file = '%s/%s' % (U_BOOT_PATH, cmds[k])
    #print(target_file)
    os.system('ls -l %s' % target_file)
